<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body,
        html {
            margin: 0;
        }

        .body {
            display: flex;
        }

        .side {
            width: 200px;
            will-change: width;
            position: relative;
            background-color: #00f;
        }

        .sidebar {
            width: inherit;
            position: fixed;
            max-height: 100vh;

        }

        .sidebar:hover {
            overflow-y: auto;
        }

        .sidebarwrapper {
            text-align: center;
            height: 200vh;
            background-color: red;
            width: inherit;
            opacity: 0.5;
        }
    </style>
</head>

<body>
    <div class="body">
        <div class="side">
            <div class="sidebar">
                <div class="sidebarwrapper">
                    这是内容
                </div>
            </div>
        </div>
        <div class="container">
            content
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            content
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            content
        </div>
    </div>
</body>

</html>